<script type="text/javascript" src="${base}/scripts/cggl/cgdcontent.js"></script>
<form id="cgdglForm" method="post" class="easyui-tabs" fit="true">
<input name="cgd.id" type="hidden" value="${(cgd.id)!''}"/>
<input type="hidden" id="cgd_ewmtime" value="${(ewmtime)!}"/>

<div title="入库单" style="height: 100%;overflow-y: auto">
    <table style="width:98%;margin: 5px" class="tb tab-t">
        <col width="80px"/>
        <col width=""/>
        <col width="80px"/>
        <col width=""/>
        <col width="80px"/>
        <col width=""/>
        <tr id="cgd_cght_choose">
        <#if htType??&&htType == "cgrk">
            <th style="font-size:14px;font-weight:bold">采购合同：</th>
        <#else>
            <#if htType == "tpcght">
                <th style="font-size:14px;font-weight:bold">统配合同：</th>
            <#else>
                <th style="font-size:14px;font-weight:bold">保供合同：</th>
            </#if>
        </#if>
            <td><input id="cgd_cght_id" name="cgd.cght.id" type="text" value="<#if cgd.cght??>${(cgd.cght.id)!}</#if>"
                       class="input-text"/></td>
        </tr>
    </table>
    <table id="table_cgdcontent" style="width:98%;margin: 5px;display: none" class="tb tab-t t-bor">
        <col width="100px"/>
        <col width=""/>
        <col width="80px"/>
        <col width=""/>
        <col width="80px"/>
        <col width=""/>
        <tr>
            <input id="cgd_cgdh_hidden" type="hidden" name="cgd.cgdh" value="${(cgd.cgdh)!}"/>
            <th style="font-size:14px;font-weight:bold">入库单号：</th>
            <td id="cgd_cgdh" style="font-size:14px;font-weight:bold">${(cgd.cgdh)!}
            </td>

            <th style="color:#f45212;">采购时间：</th>
            <td id="cgd_cgsj"><input style="width:130px" name="cgd.cgsj" class="easyui-datebox input-text"
                                     value="<#if cgd.id??>${(cgd.cgsj?date)!}<#else>${sysdate?date}</#if>"/></td>
            <th>代垫运费：</th>
            <td id="cgd_dsfyje"><input style="width:130px" name="cgd.dsyfje" class="easyui-numberbox input-text" data-options="precision:2,min:0"
                                     value="<#if cgd.id??>${(cgd.dsyfje)!}</#if>"/></td>
        </tr>
        <tr>
            <input type="hidden" name="cgd.cglx" value="${(cgd.cglx)!}"/>
            <input type="hidden" id="cgd_gys_id" name="cgd.gys.id" value="${(cgd.gys.id)!}"/>
            <input type="hidden" id="cgd_lj_id" name="cgd.lj.id" value="${(cgd.lj.id)!}"/>
        <#if htType??&&htType == "cgrk">
            <th style="font-size:14px;font-weight:bold">采购合同：</th>
        <#else>
            <#if htType == "tpcght">
                <th style="font-size:14px;font-weight:bold">统配合同：</th>
            <#else>
                <th style="font-size:14px;font-weight:bold">保供合同：</th>
            </#if>
        </#if>
            <td id="cgd_cght_htbm" style="font-size:14px;font-weight:bold">${(cgd.cght.htbm)!}</td>
            <input type="hidden" id="htType_id" value="${(htType)!}"/>
            <th style="font-size:14px;font-weight:bold">采购类型：</th>
            <td id="cgd_cglx" style="font-size:14px;font-weight:bold">
            <#if cgd?? && cgd.cglx?? && cgd.cglx=="cgrk" >采购入库<#else>
                <#if cgd?? && cgd.cglx?? && cgd.cglx=="zddh" >
                    直达到货<#elseif cgd?? && cgd.cglx?? && cgd.cglx=="bght">
                    保供采购<#else>统配采购</#if>
            </#if>
            </td>

            <th style="font-size:14px;font-weight:bold">供应商：</th>
            <td id="cgd_gys_mc" style="font-size:14px;font-weight:bold">${(cgd.gys.jc)!}</td>
        </tr>
        <tr>
            <input type="hidden" name="cgd.sbgs.id" value="${(cgd.sbgs.id)!}"/>
            <th style="font-size:14px;font-weight:bold">申报公司：</th>
            <td id="cgd_wlfgs_mc" style="font-size:14px;font-weight:bold">${(cgd.sbgs.jc)!}</td>

            <input type="hidden" name="cgd.sbbm.id" value="${(cgd.sbbm.id)!}"/>
            <th style="font-size:14px;font-weight:bold">申报部门：</th>
            <td id="cgd_wlfbm_mc" style="font-size:14px;font-weight:bold">${(cgd.sbbm.qc)!}</td>

            <input type="hidden" name="cgd.sbr.id" value="${(cgd.sbr.id)!}"/>
            <th style="font-size:14px;font-weight:bold">申报人：</th>
            <td id="cgd_wlfry_mc"
                style="font-size:14px;font-weight:bold">${(cgd.sbr.xm)!}</td>
        </tr>
        <tr>
            <input type="hidden" name="cgd.cggs.id" value="${(cgd.cggs.id)!}"/>
            <th style="font-size:14px;font-weight:bold">采购公司：</th>
            <td id="cgd_cggs_mc" style="font-size:14px;font-weight:bold">${(cgd.cggs.jc)!}</td>
            <th>发货单位：</th>
            <td>
                <input id="cgd_fhgs_id" name="cgd.fhgs.id" type="text" value="${(cgd.fhgs.id)!}"
                       class="input-text"/>
            </td>
            <th>发货日期：</th>
            <td id="cgd_fhrq"><input style="width:130px" name="cgd.fhrq" class="easyui-datebox input-text"
                                     value="<#if cgd.id??>${(cgd.fhrq?date)!}<#else>${sysdate?date}</#if>"/></td>
        </tr>
        <tr>
            <th>计划到货日期：</th>
            <td id="cgd_jhdhrq"><input style="width:130px" name="cgd.jhdhrq" class="easyui-datebox input-text"
                                       value="<#if cgd.id??>${(cgd.jhdhrq?date)!}<#else>${datetime?date}</#if>"/>
            </td>
            <th>承运单位：</th>
            <td><input id="cgd_ysdw_id" name="cgd.ysdw.id" type="text" value="${(cgd.ysdw.id)!}"
                       class="input-text"/></td>
            <th>承运号：</th>
            <td><input id="cgd_cyh" name="cgd.cyh" type="text" style="width:130px" value="${(cgd.cyh)!}"
                       class="input-text"/></td>
        </tr>
        <tr>
        <#--<th>车船号：</th>-->
        <#--<td>-->
        <#--&lt;#&ndash;<input id="cgd_cch_id" name="cgd.cch.id" type="text" value="${(xsd.kh.id)!}"&ndash;&gt;-->
        <#--&lt;#&ndash;class="input-text"/>&ndash;&gt;-->
        <#--</td>-->
            <th>到货仓库：</th>
            <td><input id="cgd_dhck_id" name="cgd.dzck.id" type="text" value="${(cgd.dzck.id)!}"
                       class="input-text" required="true"/></td>
            <#--<th>付款时间：</th>
            <td><input id="cgd_fksj" style="width:170px" name="cgd.fksj" class="easyui-datebox input-text"
                                       value="<#if cgd.id??>${(cgd.fksj?date)!}<#else></#if>"/>-->
            <th>税率(%)：</th>
            <td><input id="cgd_sl" name="cgd.sl" style="width:130px" class="easyui-combobox input-text" type="text"
                       data-options="precision:4,min:0,max:100" value="${(cgd.sl)!}"/></td>
        </tr>
        <tr name="tr_cgdxsdcontent">
            <input name="cgd.xsd.id" type="hidden" value="${(cgd.xsd.id)!''}"/>
            <th style="font-size:14px;font-weight:bold">销售单号：</th>
            <td colspan="3" style="font-size:14px;font-weight:bold">${(cgd.xsd.xsdh)!}
            </td>
            <th style="font-size:14px;font-weight:bold">综合服务费(%):</th>
            <td id="cgd_cght_ll" style="font-size:14px;font-weight:bold">${(cgd.cght.ll?string(",##0.0000"))!}
            </td>
        </tr>
        <tr name="tr_cgdxsdcontent">
            <th style="font-size:14px;font-weight:bold">销售合同：</th>
            <input type="hidden" id="cgd_xsd_xsht_id" name="cgd.xsd.xsht.id"/>
            <td id="cgd_xsd_xsht_htbm" style="font-size:14px;font-weight:bold">${(cgd.xsd.xsht.htbm)!}</td>

            <input type="hidden" id="cgd_xsd_hzf_id" name="cgd.xsd.kh.id"/>
            <th style="font-size:14px;font-weight:bold">客户名称：</th>
            <td id="cgd_xsd_hzf_jc" style="font-size:14px;font-weight:bold">${(cgd.xsd.kh.jc)!}</td>

            <th>提货人：</th>
            <td>
                <input class="input-text" name="cgd.xsd.thr" value="${(cgd.xsd.thr)!}"/>
            </td>
        </tr>
        <tr name="tr_cgdxsdcontent">
            <th style="font-size:14px;font-weight:bold">总部销售：</th>
            <td>
                <input type="checkbox" id="cgd_xsd_zbcg" name="cgd.xsd.zbcg" value="true"
                       <#if cgd?? && cgd.xsd?? &&cgd.xsd.sbgs.id!=cgd.xsd.xsgs.id>checked</#if>/>
            </td>
            <th style="font-size:14px;font-weight:bold">销售公司：
                <input type="hidden" name="cgd.xsd.xsgs.id" value="${(cgd.xsd.xsgs.id)!}"/>
            </th>
            <td id="cgd_xsd_xsgs_jc" style="font-size:14px;font-weight:bold">
            ${(cgd.xsd.xsgs.jc)!}
            </td>
            <th style="font-size:14px;font-weight:bold">工程：</th>
            <td>
                <input id="cgd_xsd_gc_id" name="cgd.xsd.gc.id" type="text" value="${(cgd.xsd.gc.id)!}"
                       class="input-text"/>
            </td>
        </tr>
        <#--<tr>-->
            <#--<th>是否过户：</th>-->
            <#--<td><input name="cgd.sfgh" type="checkbox" value="true"-->
                       <#--<#if cgd?exists && cgd.sfgh>checked </#if>/></td>-->
            <#--<td  style="color:#f45212;" colspan="4">过户操作被勾选表示此物资之前已经被仓储系统线下入库并设置成了一般物资,提交之后,将把这批物资更改成监管物资</td>-->
        <#--</tr>-->
        <tr>
            <th>备注：</th>
            <td colspan="5"><textarea name="cgd.bz" cols="45" class="textarea"
                                      style="width: 100%">${(cgd.bz)!}</textarea></td>
        </tr>
    </table>
</div>
<div title="入库明细">
    <div id="cgdgl_cgdmx_toolbar">
        <div class="PTools">
            <ul class="niu">
            <#--<#if htType!="bght" >-->
                <#--<li><a id="cgd_content_mx_add" href="javascript:void(0);" plain="true">新增</a></li>-->
                <#--<li><a id="cgd_content_mx_del" href="javascript:void(0);" class="del" plain="true">删除</a></li>-->
            <#--</#if>-->
            </ul>
        </div>
    </div>
    <table id="cgd_mx">
    </table>
</div>
<div title="关联费用">
    <div id="cgdgl_cgdfy_toolbar">
        <div class="PTools">
            <ul class="niu">
                <li><a id="cgd_content_glfy_add" href="javascript:void(0);" plain="true">新增</a></li>
                <li><a id="cgd_content_glfy_del" href="javascript:void(0);" class="del" plain="true">删除</a></li>
            </ul>
        </div>
    </div>
    <table id="cgd_fy">
    </table>
</div>
</form>